﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:converter="clr-namespace:InChatter.Client.WPFClient.Utility"
             x:Class="InChatter.Client.WPFClient.View.MessageControl" 
             mc:Ignorable="d" Loaded="UserControl_Loaded"
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/InChatter.Client.WPFClient;component/Style/DefaultStyle.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <converter:MsgCountVisibilityConverter x:Key="msgCountVisibilityConverter"></converter:MsgCountVisibilityConverter>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <StackPanel Orientation="Horizontal">
            <Image  Name="imageNoEmail" Cursor="Hand"
                   HorizontalAlignment="Right" 
                   VerticalAlignment="Bottom" 
                   Height="20"
                   Stretch="Uniform"
                   Source="/InChatter.Client.WPFClient;component/Images/email.png">
                <Image.InputBindings>
                    <MouseBinding MouseAction="LeftClick" Command="{Binding cmd_ShowHistoryWindow}"></MouseBinding>
                </Image.InputBindings>
            </Image>
            <TextBlock FontSize="14" FontWeight="Bold" Margin="5,0,5,0" HorizontalAlignment="Right" VerticalAlignment="Bottom" Visibility="{Binding Count,Converter={StaticResource msgCountVisibilityConverter}}">
                <Hyperlink Command="{Binding cmd_ShowMessageWindow}">(<Run Text="{Binding Count}"></Run>)</Hyperlink>
            </TextBlock>
        </StackPanel>
    </Grid>
</UserControl>
